FlattenMovie
TheFlattenMovie
function creates a new movie file containing a specified movie. This file also contains all the data for the movie--that is, the Movie Toolbox resolves any data references and includes the corresponding movie data in the new movie file.
pascal void FlattenMovie (Movie theMovie, long movieFlattenFlags, const FSSpec *theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, short *resId, const StringPtr resName);
theMovie
- Specifies the movie for this operation. Your application obtains this movie identifier from such functions as
NewMovie
,NewMovieFromFile
, andNewMovieFromHandle
(described on page 2-80, page 2-76, and page 2-78, respectively).movieFlattenFlags
- Controls the process of adding movie data to the new movie file. The following flags are available (be sure to set unused flags to 0):
flattenAddMovieToDataFork
- Causes the movie to be placed in the data fork of the new movie file, as well as in the resource fork. You may use this flag to create movie files that are more easily moved to other computer systems from your Macintosh.
flattenDontInterleaveFlatten
- Allows you to disable the Movie Toolbox's data storage optimizations. By default, the Movie Toolbox stores movie data in a format that is optimized for playback. Set this flag to 1 to disable these optimizations.
flattenActiveTracksOnly
- Causes the Movie Toolbox to add only enabled movie tracks to the new movie file. You can use the
SetTrackEnabled
function, described on page 2-132, to enable and disable movie tracks.theFile
- Contains a pointer to the file system specification for the movie file to be created.
creator
- Specifies the creator value for the new file.
scriptTag
- Specifies the script in which the movie file should be created. Set this parameter to the Script Manager constant
smSystemScript
to use the system script; set it tosmCurrentScript
to use the current script. See Inside Macintosh: Text for more information about scripts and script tags.createMovieFileFlags
- Controls file creation options. The following flag is available:
createMovieFileDeleteCurFile
- Indicates whether to delete an existing file. If you set this flag to 1, the Movie Toolbox deletes the file (if it exists) before creating the new movie file. If this flag is set to 0 and the file specified by the
fileSpec
parameter already exists, the Movie Toolbox uses the existing file. In this case, the toolbox ensures that the file has both a data and a resource fork. If this flag is not set, the data is appended to the file.resId
- Contains a pointer to a field that contains the resource ID number for the new resource. If the field referred to by the
resId
parameter is set to 0, the Movie Toolbox assigns a unique resource ID number to the new resource. The toolbox then returns the movie's resource ID number in the field referred to by theresId
parameter. The Movie Toolbox assigns resource ID numbers sequentially, starting at 128. If theresId
parameter is set tonil
, the Movie Toolbox assigns a unique resource ID number to the new resource and does not return that resource's ID value.resName
- Points to a character string with the name of the movie resource. If you set the
resName
parameter tonil
, the toolbox creates an unnamed resource.DESCRIPTION
The toolbox places the movie resource into the resource fork of the movie file. The Movie Toolbox does not alter the source movie.The Movie Toolbox calls your progress function during long operations.
ERROR CODES
File Manager errors
invalidMovie -2010 This movie is corrupted or invalid progressProcAborted -2019 Your progress function returned an error cantCreateSingleForkFile -2022 Error trying to create a single-fork file
Memory Manager errors
Resource Manager errors